package com.dl.code.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dl.code.entity.UserRole;
import com.dl.code.mapper.UserRoleMapper;
import com.dl.code.service.UserRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * 作者: DL代先生
 * 日期: 2021/5/29
 * 时间: 23:47
 * 内容: Shiro与springboot整合教程！
 * 描述:
 */
@Service
public class UserRoleServiceImpl implements UserRoleService {
    @Resource
    private UserRoleMapper userRoleMapper;

    @Override
    public UserRole selectAllUserRoles(Integer userId) {
        QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id",userId);
        UserRole userRole = userRoleMapper.selectOne(queryWrapper);
        return userRole;
    }
}
